package cn.sy.exception;

public class GlobalCustomException extends RuntimeException{
    // 异常信息
    private String errorMessage;

    // 异常码
    private String errorCode;

    public GlobalCustomException(){
        super();
    }

    public GlobalCustomException(GlobalErrorCodeEnum globalErrorCode){
        super(globalErrorCode.getMessage());
        this.errorCode = globalErrorCode.getCode();
        this.errorMessage = globalErrorCode.getMessage();
    }

    public GlobalCustomException(GlobalCustomException globalCustomException){
        super();
        this.errorMessage = globalCustomException.errorMessage;
        this.errorCode = globalCustomException.errorCode;
    }

    public GlobalCustomException(String s) {
    }


    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }
}
